﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace GuildofHeroes
{
    class Warrior : Player
    {
        int _AdditionalHealth = 25;        
        int _AdditionalStrength = 8;
        int _AdditionalConstitution = 6;

        public Warrior(Texture2D pTexture2D, int pPosX, int pPosY, int pNumFrames, int pFrameWidth, int pFrameHeight,
            int pHorizontalSpace, int pVerticalSpace, int pFramesPerSec, float pScale) : 
                                                                    base (pTexture2D, pPosX, pPosY, pNumFrames, pFrameWidth, pFrameHeight, pHorizontalSpace, pVerticalSpace, pFramesPerSec, pScale)
        {            
            base._BaseConstitution += _AdditionalConstitution;
            base._BaseStrength += _AdditionalStrength;
            base._BaseHealth += _AdditionalHealth + _BaseConstitution / 2;
            base._BaseDamage += _BaseStrength / 5;
            base.m_Health = base._BaseHealth;
        }

        public override void Draw(SpriteBatch _spriteBatch, SpriteFont _spriteFont)
        {
            _spriteBatch.DrawString(_spriteFont, "Health: " + this.GetHealth().ToString(), new Vector2(20, 20), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Gold: " + this.GetGold().ToString(), new Vector2(200, 20), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Exp: " + this.GetExp().ToString(), new Vector2(20, 120), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Level: " + this.GetLevel().ToString(), new Vector2(20, 170), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Next Level: " + this.GetNextLevel().ToString(), new Vector2(20, 220), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Dmg Rating: " + this.GetDmgRating().ToString(), new Vector2(20, 250), Color.White);
            base.Draw(_spriteBatch, _spriteFont);
        }

        public override void LevelUp()
        {
            base.LevelUp();
            _BaseHealth += 20 + (_Level + _BaseConstitution / 2);
            _BaseDamage += 1;
            m_Health = _BaseHealth; 
        }
    }
}
